#include <stdio.h>
#include<string.h>
 
int main(){
    int operandos, inst = 1;
 
    while( scanf( "%d", &operandos ) ){
        if( !operandos ){
            return 0;
        }
 
        char exp[operandos*4], *d, *c;
        long soma = 0, num;
 
        scanf( "%s", exp );
 
        soma += strtol( exp, &d, 10 );
        c = d;
 
        while( *c ){
            if( *c == '+' ){
                c++;
                soma += strtol( c, &d, 10 );
            }
            else{
                c++;
                soma -= strtol( c, &d, 10 );
            }
            c = d;
        }
 
        printf( "Teste %d\n%d\n\n", inst++, soma );
    }
}
